function PictureSlider(container, images, controls)
{
	/*Controls must have right and left: controls.right controls.left these are DOM elements*/
	/*urls is an array of string for each image url*/
	/*Container is where the generated img element is going to live*/
	this.containerEl = container;
	this.backEl = controls.left;
	this.nextEl = controls.right;
	this.currentImageIndex;
	this.doNext = function()
	{
		if(images.length > 1)
		{
			if(this.currentImageIndex + 1 < images.length)
			{
				this.currentImageIndex++;
			}
			else
			{
				this.currentImageIndex = 0;
			}
			this.showImage(images[this.currentImageIndex].url);
		}
	}
	this.showImage = function(url)
	{
		$(this.containerEl).html("");
		var img = $("<img>");
		$(img).attr("src", url);
		$(this.containerEl).append(img);
	}
	this.doBack = function()
	{
		if(images.length > 1)
		{
			if(this.currentImageIndex - 1 >= 0)
			{
				this.currentImageIndex--;
			}
			else
			{
				this.currentImageIndex = images.length - 1;
			}
			this.showImage(images[this.currentImageIndex].url);
		}
	}
	this.init = function()
	{
		debugger;
		
		var thisObj = this;
		this.showImage(images[0].url);
		this.currentImageIndex = 0;
		$(this.backEl).on("click", function(){thisObj.doBack();});
		$(this.nextEl).on("click", function(){thisObj.doNext();});
	}
	this.init();
}